package com.wicket.okrcomponent.web.contorller;

import cn.hutool.core.bean.BeanUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.page.PageMethod;
import com.wicket.okrcomponent.biz.service.ResourceFileService;
import com.wicket.okrcomponent.biz.service.dto.req.*;
import com.wicket.okrcomponent.biz.service.dto.res.*;
import com.wicket.okrcomponent.common.ro.OkrResult;
import com.wicket.okrcomponent.common.util.CommonFunctionHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@RestController
@RequestMapping("/comp/resourceFile/")
public class ResourceFileController {

  @Autowired
  ResourceFileService resourceFileService;
/**
   * D2删除REDIS物理文件记录(redis)(公共)
   */
    @PostMapping("deletePhyFileRedisRecordCom")
    public OkrResult<DeletePhyFileRedisRecordComRespDto> deletePhyFileRedisRecordCom(@RequestBody @Validated DeletePhyFileRedisRecordComReqDto reqDTO){
    return OkrResult.success(resourceFileService.deletePhyFileRedisRecordCom(reqDTO));
    }
/**
   * D2新增物理文件路径记录到缓存(redis)(公共)
   */
    @PostMapping("addPhyFileToRedisCom")
    public OkrResult<AddPhyFileToRedisComRespDto> addPhyFileToRedisCom(@RequestBody @Validated AddPhyFileToRedisComReqDto reqDTO){
    return OkrResult.success(resourceFileService.addPhyFileToRedisCom(reqDTO));
    }
/**
   * D2循环生成资源文件相对路径并缓存相对路径(公共)
   */
    @PostMapping("loopSetResourceFileCom")
    public OkrResult<LoopSetResourceFileComRespDto> loopSetResourceFileCom(@RequestBody @Validated LoopSetResourceFileComReqDto reqDTO){
    return OkrResult.success(resourceFileService.loopSetResourceFileCom(reqDTO));
    }
/**
   * D2执行资源文件上传第三方系统(公共)
   */
    @PostMapping("implementResourceFileTransSystemCom")
    public OkrResult<ImplementResourceFileTransSystemComRespDto> implementResourceFileTransSystemCom(@RequestBody @Validated ImplementResourceFileTransSystemComReqDto reqDTO){
    return OkrResult.success(resourceFileService.implementResourceFileTransSystemCom(reqDTO));
    }
/**
   * D2执行资源文件上链(公共)
   */
    @PostMapping("implementEviFileChainCom")
    public OkrResult<ImplementEviFileChainComRespDto> implementEviFileChainCom(@RequestBody @Validated ImplementEviFileChainComReqDto reqDTO){
    return OkrResult.success(resourceFileService.implementEviFileChainCom(reqDTO));
    }
/**
   * D2生成上链签名(公共)
   */
    @PostMapping("obtainChainTokenCom")
    public OkrResult<ObtainChainTokenComRespDto> obtainChainTokenCom(@RequestBody @Validated ObtainChainTokenComReqDto reqDTO){
    return OkrResult.success(resourceFileService.obtainChainTokenCom(reqDTO));
    }
/**
   * D2执行资源文件上区块链(公共)
   */
    @PostMapping("implementEviFilesChainCom")
    public OkrResult<ImplementEviFilesChainComRespDto> implementEviFilesChainCom(@RequestBody @Validated ImplementEviFilesChainComReqDto reqDTO){
    return OkrResult.success(resourceFileService.implementEviFilesChainCom(reqDTO));
    }
/**
   * D2生成资源文件问答内容(公共)
   */
    @PostMapping("generateResourceFileQuestionContentCom")
    public OkrResult<GenerateResourceFileQuestionContentComRespDto> generateResourceFileQuestionContentCom(@RequestBody @Validated GenerateResourceFileQuestionContentComReqDto reqDTO){
    return OkrResult.success(resourceFileService.generateResourceFileQuestionContentCom(reqDTO));
    }
/**
   * D2加载资源文件到内存(公共)
   */
    @PostMapping("downLoadResourceFileCom")
    public OkrResult<DownLoadResourceFileComRespDto> downLoadResourceFileCom(@RequestBody @Validated DownLoadResourceFileComReqDto reqDTO){
    return OkrResult.success(resourceFileService.downLoadResourceFileCom(reqDTO));
    }
/**
   * D2组装资源文件提问列表
   */
    @PostMapping("assembleFileQListCom")
    public OkrResult<AssembleFileQListComRespDto> assembleFileQListCom(@RequestBody @Validated AssembleFileQListComReqDto reqDTO){
    return OkrResult.success(resourceFileService.assembleFileQListCom(reqDTO));
    }
/**
   * D2获取阿里云文件(公共)
   */
    @PostMapping("loadAliYunFileCom")
    public OkrResult<LoadAliYunFileComRespDto> loadAliYunFileCom(@RequestBody @Validated LoadAliYunFileComReqDto reqDTO){
    return OkrResult.success(resourceFileService.loadAliYunFileCom(reqDTO));
    }
/**
   * D2获取minio文件(公共)
   */
    @PostMapping("loadMinioFileCom")
    public OkrResult<LoadMinioFileComRespDto> loadMinioFileCom(@RequestBody @Validated LoadMinioFileComReqDto reqDTO){
    return OkrResult.success(resourceFileService.loadMinioFileCom(reqDTO));
    }
/**
   * D2获取本地文件(公共)
   */
    @PostMapping("loadLocalFileCom")
    public OkrResult<LoadLocalFileComRespDto> loadLocalFileCom(@RequestBody @Validated LoadLocalFileComReqDto reqDTO){
    return OkrResult.success(resourceFileService.loadLocalFileCom(reqDTO));
    }
}
